<template>
  <div>
    <div class="title">热销推荐</div>
    <ul>
      <router-link tag="li" class="item border-bottom" v-for="item in recommendList" :key="item.id" :to="'/detail/' + item.id">
        <img class="item-img" :src="item.imgUrl" alt="">
        <div class="item-info">
          <p class="item-title">{{ item.title }}</p>
          <p class="item-desc">{{ item.desc }}</p>
          <button class="item-btn">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    recommendList: Array
  },
  data () {
    return {
    }
  }
}
</script>

<style lang="stylus" scoped>
  .title
    line-height .8rem
    font-size .3rem
    text-indent 1em
    background #ccc
  .item
    display flex
    overflow hidden
    height 2rem
    padding .08rem
    .item-img
      width 2rem
      height 2rem
      padding .1rem
    .item-info
      display flex
      flex-direction column
      justify-content space-between
      flex 1
      padding .1rem
      padding .1rem
      .item-title
        font-size .3rem
      .item-desc
        font-size .2rem
        padding-right 6.25rem
        overflow hidden
        white-space nowrap
        text-overflow ellipsis
      .item-btn
        width 2rem
        background orange
        color #fff
        padding .12rem
</style>
